
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module runtime.grid</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="runtime.html"><font color="#ffffff">runtime</font></a>.grid</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/john/bin/game-baker/trunk/runtime/grid.py">/home/john/bin/game-baker/trunk/runtime/grid.py</a></font></td></tr></table>
    <p><tt>#&nbsp;grid&nbsp;classes<br>
#&nbsp;TODO:&nbsp;needs&nbsp;to&nbsp;be&nbsp;structured&nbsp;so&nbsp;that&nbsp;move_h,&nbsp;etc.&nbsp;are&nbsp;called&nbsp;from&nbsp;<a href="#ObjBlock">ObjBlock</a>&nbsp;instances<br>
#<br>
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;needs&nbsp;capability&nbsp;for&nbsp;large&nbsp;objects&nbsp;which&nbsp;extend&nbsp;between&nbsp;cells</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="runtime.grid.html#Grid">Grid</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="runtime.grid.html#SquareGrid">SquareGrid</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="runtime.grid.html#ObjBlock">ObjBlock</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Grid">class <strong>Grid</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Grid-__init__"><strong>__init__</strong></a>(self, upper_right_coords<font color="#909090">=[0, 0]</font>)</dt></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="ObjBlock">class <strong>ObjBlock</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Represents&nbsp;an&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;located&nbsp;on&nbsp;the&nbsp;grid<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="ObjBlock-__init__"><strong>__init__</strong></a>(self, x, y, x_len, y_len)</dt><dd><tt>#&nbsp;needs&nbsp;a&nbsp;LOT&nbsp;more...</tt></dd></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="SquareGrid">class <strong>SquareGrid</strong></a>(<a href="runtime.grid.html#Grid">Grid</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="runtime.grid.html#SquareGrid">SquareGrid</a></dd>
<dd><a href="runtime.grid.html#Grid">Grid</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="SquareGrid-__init__"><strong>__init__</strong></a>(self, x_blocks, y_blocks, block_size<font color="#909090">=[10, 10]</font>, upper_right_coords<font color="#909090">=[0, 0]</font>)</dt></dl>

<dl><dt><a name="SquareGrid-add_object"><strong>add_object</strong></a>(self, obj_name, start_x, start_y)</dt></dl>

<dl><dt><a name="SquareGrid-block_is_occupied"><strong>block_is_occupied</strong></a>(self, x, y)</dt></dl>

<dl><dt><a name="SquareGrid-get_obj_coords"><strong>get_obj_coords</strong></a>(self, obj_name)</dt><dd><tt>returns&nbsp;<a href="__builtin__.html#object">object</a>'s&nbsp;coordinates&nbsp;in&nbsp;actual&nbsp;x/y&nbsp;plane</tt></dd></dl>

<dl><dt><a name="SquareGrid-get_obj_loc"><strong>get_obj_loc</strong></a>(self, obj_name)</dt><dd><tt>returns&nbsp;<a href="__builtin__.html#object">object</a>'s&nbsp;location&nbsp;on&nbsp;grid</tt></dd></dl>

<dl><dt><a name="SquareGrid-is_legal_move"><strong>is_legal_move</strong></a>(self, x, y)</dt></dl>

<dl><dt><a name="SquareGrid-is_outside_bounds"><strong>is_outside_bounds</strong></a>(self, x, y)</dt></dl>

<dl><dt><a name="SquareGrid-move"><strong>move</strong></a>(self, obj_name, dx<font color="#909090">=0</font>, dy<font color="#909090">=0</font>)</dt><dd><tt>Move&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;relative&nbsp;to&nbsp;current&nbsp;position<br>
&nbsp;&nbsp;&nbsp;&nbsp;where&nbsp;dy&nbsp;is&nbsp;blocks&nbsp;to&nbsp;move&nbsp;along&nbsp;vertical&nbsp;axis<br>
&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;dx&nbsp;is&nbsp;blocks&nbsp;to&nbsp;move&nbsp;along&nbsp;horizontal&nbsp;axis<br>
&nbsp;&nbsp;&nbsp;&nbsp;NOTE:&nbsp;current&nbsp;design&nbsp;evaluates&nbsp;horizontal&nbsp;moves<br>
&nbsp;&nbsp;&nbsp;&nbsp;first,&nbsp;so&nbsp;collision&nbsp;detection&nbsp;may&nbsp;not&nbsp;work<br>
&nbsp;&nbsp;&nbsp;&nbsp;properly&nbsp;if&nbsp;large&nbsp;numbers&nbsp;are&nbsp;used.</tt></dd></dl>

<dl><dt><a name="SquareGrid-set_loc"><strong>set_loc</strong></a>(self, obj_name, x, y)</dt><dd><tt>set&nbsp;arbitrary&nbsp;location</tt></dd></dl>

<hr>
Data descriptors inherited from <a href="runtime.grid.html#Grid">Grid</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table></td></tr></table>
</body></html>